<?
session_start();
include "check_sessao.php";
include "check_adm.php";
?>
<html>
<head>
<title>Afagu Cards</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<script language="JavaScript">
function formatacaoData(f,e,tecla){
	var Code;
	if (navigator.appName == 'Microsoft Internet Explorer') {Code = tecla.keyCode;} 
	else if (navigator.appName == 'Netscape') {Code = tecla.which;}
	var s = document.forms[f].elements[e].value;
	var Leng = s.length;
	if (Leng == 2){document.forms[f].elements[e].value = s + "/";}   
	if (Leng == 5){document.forms[f].elements[e].value = s + "/";}   
}
function abrirurl(url){document.location.href = url;}
function deletephp(urlphp){if(confirm("Confirma exclus�o?")) {document.location.href = urlphp;}}

function ValidaForm(){
  if (document.form1.nome.value.length == 0) {
    window.alert("Erro! O Nome � obrigat�rio.");
    document.form1.nome.focus();
	return false;
  }
  if (document.form1.login.value.length == 0) {
    window.alert("Erro! O Login � obrigat�rio.");
    document.form1.login.focus();
	return false;
  }

  if (document.form1.senha.value.length == 0) {
    window.alert("Erro! A Senha � obrigat�ria.");
    document.form1.senha.focus();
	return false;
  }

  if (document.form1.confirmacao.value.length == 0) {
    window.alert("Erro! A Confirma��o da senha � obrigat�ria.");
    document.form1.confirmacao.focus();
	return false;
  }

  if (document.form1.senha.value != document.form1.confirmacao.value ) {
    window.alert("Erro! A confirma��o est� diferente da senha.");
    document.form1.senha.focus();
	return false;
  }

  if (document.form1.tipo.value == -1) {
    window.alert("Erro! O Tipo � obrigat�rio.");
    document.form1.tipo.focus();
	return false;
  }
}

</script>
<body>
<table width="770" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr> 
    <td colspan="2"> 
      <? include "banner.php"?>
    </td>
  </tr>
  <tr>
    <td align="left" valign="top">&nbsp;</td>
    <td align="center" valign="top" class="Cabecalho">Novo Coordenador </td>
  </tr>
  <tr> 
    <td width="3%" align="left" valign="top"> 
      <? include "menu.php"?>
    </td>
    <td width="97%" align="center" valign="top">
      <form name="form1" method="post" action="ADM_SPT_insert_coordenador.php" onSubmit="return(ValidaForm())">
        <table width="100%" border="0" cellpadding="2" cellspacing="2" class="Formulario">
          <tr> 
            <td width="11%" class="LabelForm"><div align="right">Nome:</div></td>
            <td width="89%"><input name="nome" type="text" id="nome" size="50" width="300" ></td>
          </tr>
          <tr> 
            <td class="LabelForm"><div align="right">Login:</div></td>
            <td><input name="login" type="text" id="login"></td>
          </tr>
          <tr> 
            <td class="LabelForm"><div align="right">Senha:</div></td>
            <td><input name="senha" type="password" id="senha"></td>
          </tr>
          <tr> 
            <td height="28" class="LabelForm"><div align="right">Confirma&ccedil;&atilde;o:</div></td>
            <td><input name="confirmacao" type="password" id="confirmacao"></td>
          </tr>
          <tr> 
            <td height="23" class="LabelForm"><div align="right">Tipo:</div></td>
	    <td>
	      <select name="tipo" id="tipo">
             	 <option selected value="0">Administrador</option>
                 <option value="1">Regional</option>
	             <option value="2">Cidade</option>	
          </select> 
	    </td>
          </tr>
          <tr> 
            <td class="LabelForm"><div align="right">Fone:</div></td>
            <td><input name="fone" type="text" id="fone"></td>
          </tr>
          <tr> 
            <td class="LabelForm"><div align="right">Celular:</div></td>
            <td><input name="celular" type="text" id="celular"></td>
          </tr>
          <tr> 
            <td class="LabelForm"><div align="right">e-mail:</div></td>
            <td><input name="email" type="text" id="email" size="50" width="300"></td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td><input type="submit" name="salvar" value="Salvar"> 
			    <input type="button" name="cancelar" value="Cancelar" onClick="javascript:abrirurl('ADM_CAD_List_coordenadores.php')">
			</td>
          </tr>
        </table>
      </form>
      </td>
  </tr>
</table>
</body>
</html>
